package com.miao.im.common.enums;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/2/25 17:29
 * @Description: chat消息类型
 */
public enum MediaMsgType {
    TEXT(1, "文本"),
    PIC(2, "图片"),
    VOICE(3,"语音"),
    CANCEL(10,"撤销")
    ;
    private int code;

    private String value;

    MediaMsgType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static MediaMsgType getByCode(int code) {
        for (MediaMsgType e : MediaMsgType.values()) {
            if (e.getCode() == code) {
                return e;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
